package com.zhuxi.controller;

import com.zhuxi.service.ByeService;
import com.zhuxi.service.HelloService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.apache.dubbo.config.annotation.Reference;

@Controller
public class DemoController {

    @Reference
    private HelloService helloService;

    @Reference
    private ByeService byeService;

    @RequestMapping("/index")
    public String index(Model model) throws Exception {
        String result = helloService.sayHello("world");
        String result2 = byeService.sayBye("world");
        System.out.println(result);
        System.out.println(result2);
        model.addAttribute("result",result);
        return "index";
    }

}
